package Lesson17.Car;

public class Car 
{
	protected String model;
	private double maxSpeed = 230;
	protected double currentSpeed;
	protected int currentGear;
	protected int numberOfDoors;
	protected long idNumber;
	protected boolean isSportCar;
	protected Person owner;
	
	protected String type = "Just a car";
	
	Car(double maxSpeed)
	{
		this.maxSpeed = maxSpeed;
	}
	
	protected void setMaxSpeed(double maxSpeed)
	{
		this.maxSpeed = maxSpeed;
	}
	
	protected void changeOwner (Person newOwner)
	{
		
	}
	
	protected void startEngine()
	{
		
	}
	
	protected void changeGear(int gear)
	{
		if (gear > 0 && gear < 6)
		this.currentGear = gear;
	}
	
	protected void accelerate(double speed)
	{
		if (speed <= maxSpeed)
			this.currentSpeed = speed;
		else
			this.currentSpeed = this.maxSpeed;
	}
}
